#pragma once
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include "Stack.h"

typedef char BTDataType;
typedef struct BTNode
{
	BTDataType val;
	struct BTNode* left;
	struct BTNode* right;
}BTNode;



BTNode* BinaryTreeCreate(BTDataType* arr,int n,int* pi);
void PreOrder(BTNode* root);
void InOrder(BTNode* root);
void PostOrder(BTNode* root);

void BinaryTreeDestroy(BTNode* root);


int BinaryTreeHeight(BTNode* root);
int BinaryTreeSize(BTNode* root);
int BinaryTreeLeafSize(BTNode* root);
int BinaryTreeLeafKSize(BTNode* root,int k);
BTNode* BinaryTreeFind(BTNode* root, BTDataType x);

void LevelOrder(BTNode* root);
bool BinaryTreeComplete(BTNode* root);

